package com.hxjb.service.impl;

import com.huamo.base.dao.BaseDao;
import com.hxjb.config.dynamicDSConfig.TargetDataSource;
import com.hxjb.entity.User;
import com.hxjb.service.IDynamicDSTestService;
import com.hxjb.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by wt on 2017/12/1.
 */
@Service
public class DynamicDSTestServiceImpl implements IDynamicDSTestService {

    @Autowired
    private BaseDao baseDao;

    @Override
    @TargetDataSource(name = "HXJB_LOG_SMS")
    public Integer getTicketMsgRecordCount() {
        return baseDao.selectOne("DynamicDSTestMapper.getTicketMsgRecordCount");
    }

    @Override
    @Transactional
    public void updateEmailByUserId(User user) {
        baseDao.update("DynamicDSTestMapper.updateEmailByUserId", user);
//        int i = 1 / 0;

    }
}
